import 'package:du_application/model/IndexModel.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../routes/application.dart';
import 'package:cached_network_image/cached_network_image.dart';
getGoodCard(context,GoodsList goods){
return GestureDetector(
  onTap: ()=>{
      Application.router.navigateTo(context, "/goods?id=${goods.id}")
  },
    child:Card(
 shape: new Border.all(width:0,color: Colors.white),
    margin:EdgeInsets.all(0),

   elevation: 1, 
    child: Column(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
 Expanded(
   child: Container(
     child: CachedNetworkImage(
       width: ScreenUtil().setWidth(500),
       height: ScreenUtil().setWidth(500),
       imageUrl:goods.picUrl,fit:BoxFit.fitWidth,
                           placeholder: (context, url) =>
                               Image.asset('assets/loading.jpg'),
                           // print("111");
                         ),
   ),
 ),
     
       Text(goods.name,style: TextStyle(
                ),textAlign: TextAlign.start,),
      
       Padding(
         padding:EdgeInsets.symmetric(horizontal: 5,vertical: 5),
         
         child:  Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
          Expanded(
            child:Row(
              children: <Widget>[
               Text("￥",style: TextStyle(fontSize: 10,fontWeight: FontWeight.bold,color: Colors.black),textAlign: TextAlign.end,),
                Text(goods.retailPrice.toString(),style: TextStyle(
                fontWeight: FontWeight.bold,
                fontSize: 15
                ),)
              ],
            ),
          ),
          //  Text("12121付款",style: TextStyle(
          //   color: Colors.grey[400],
          //   fontSize: 10,
          // ),)
          ],
        ),
       )
      ],
    ) ,
  ),
  
);
}